3.32 \(\int \frac{\sec (x)}{a+b \cos ^2(x)} \, dx\)

Optimal. Leaf size=41 \[ \frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b}} \]

[Out]

ArcTanh[Sin[x]]/a - (Sqrt[b]*ArcTanh[(Sqrt[b]*Sin[x])/Sqrt[a + b]])/(a*Sqrt[a + b])

________________________________________________________________________________________

Rubi [A]  time = 0.0524032, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {3186, 391, 206, 208} \[ \frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b}} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(a + b*Cos[x]^2),x]

[Out]

ArcTanh[Sin[x]]/a - (Sqrt[b]*ArcTanh[(Sqrt[b]*Sin[x])/Sqrt[a + b]])/(a*Sqrt[a + b])

Rule 3186

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Cos[e + f*x], x]}, -Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x], x, Cos
[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 391

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec (x)}{a+b \cos ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\sin (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (x)\right )}{a}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b-b x^2} \, dx,x,\sin (x)\right )}{a}\\ &=\frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b}}\\ \end{align*}

Mathematica [A]  time = 0.0556557, size = 38, normalized size = 0.93 \[ \frac{\tanh ^{-1}(\sin (x))-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{\sqrt{a+b}}}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(a + b*Cos[x]^2),x]

[Out]

(ArcTanh[Sin[x]] - (Sqrt[b]*ArcTanh[(Sqrt[b]*Sin[x])/Sqrt[a + b]])/Sqrt[a + b])/a

________________________________________________________________________________________

Maple [A]  time = 0.028, size = 47, normalized size = 1.2 \begin{align*}{\frac{\ln \left ( \sin \left ( x \right ) +1 \right ) }{2\,a}}-{\frac{b}{a}{\it Artanh} \left ({\sin \left ( x \right ) b{\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) b}}}}-{\frac{\ln \left ( \sin \left ( x \right ) -1 \right ) }{2\,a}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(a+b*cos(x)^2),x)

[Out]

1/2/a*ln(sin(x)+1)-b/a/((a+b)*b)^(1/2)*arctanh(b*sin(x)/((a+b)*b)^(1/2))-1/2/a*ln(sin(x)-1)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.87842, size = 329, normalized size = 8.02 \begin{align*} \left [\frac{\sqrt{\frac{b}{a + b}} \log \left (-\frac{b \cos \left (x\right )^{2} + 2 \,{\left (a + b\right )} \sqrt{\frac{b}{a + b}} \sin \left (x\right ) - a - 2 \, b}{b \cos \left (x\right )^{2} + a}\right ) + \log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \, a}, \frac{2 \, \sqrt{-\frac{b}{a + b}} \arctan \left (\sqrt{-\frac{b}{a + b}} \sin \left (x\right )\right ) + \log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \, a}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(b/(a + b))*log(-(b*cos(x)^2 + 2*(a + b)*sqrt(b/(a + b))*sin(x) - a - 2*b)/(b*cos(x)^2 + a)) + log(s
in(x) + 1) - log(-sin(x) + 1))/a, 1/2*(2*sqrt(-b/(a + b))*arctan(sqrt(-b/(a + b))*sin(x)) + log(sin(x) + 1) -
log(-sin(x) + 1))/a]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(a+b*cos(x)**2),x)

[Out]

Integral(sec(x)/(a + b*cos(x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.18786, size = 77, normalized size = 1.88 \begin{align*} \frac{b \arctan \left (\frac{b \sin \left (x\right )}{\sqrt{-a b - b^{2}}}\right )}{\sqrt{-a b - b^{2}} a} + \frac{\log \left (\sin \left (x\right ) + 1\right )}{2 \, a} - \frac{\log \left (-\sin \left (x\right ) + 1\right )}{2 \, a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

b*arctan(b*sin(x)/sqrt(-a*b - b^2))/(sqrt(-a*b - b^2)*a) + 1/2*log(sin(x) + 1)/a - 1/2*log(-sin(x) + 1)/a